<template>
  <div id="appraiseScroll">
    <div class="main">
      <ul
        v-infinite-scroll="loadMore"
        infinite-scroll-disabled="loading"
        infinite-scroll-distance="10"
      >
        <slot name="leaveMessageSlot"></slot>
      </ul>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
import { InfiniteScroll } from "mint-ui";
import LeaveMessage from "../Appraise/Leavemessage";

export default {
  name: "appraiseScroll",
  directives: {
    InfiniteScroll
  },
  components: {
    LeaveMessage
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  methods: {
    loadMore() {
      this.loading = true;
      setTimeout(() => {
        //调用请求地址向数组后面继续添加
        // let last = this.list[this.list.length - 1];
        // for (let i = 1; i <= 10; i++) {
        // this.list.push(last + i);
        // }
        this.loading = false;
      }, 2500);
    }
  },
  created() {},
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {} //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>

<style scoped>
</style>